package com.company;

import com.company.Tyre.*;

public class Car {
    private String color ;
    private String brand ;
    //构造函数
    public Car(){
        this.color = "黑色";
        this.brand = "宝马";

    }
    public Car(String sColor,String sBrand){
        this.color = sColor;
        this.brand = sBrand;

    }
    public  String getColor(){
        return this.color;
    }
    public String getBrand(){

        return this.brand;
    }
    public void setBrand(String sBrand){
        this.brand = sBrand;
    }
    //USESA关系
    private double gass ;
    public void checkGassEnough(){
        gass = 1+(int)(Math.random()*100);
        if (gass>=60.0)
            System.out.println("当前油量为："+gass+"升，可以启动");
        else
            System.out.println("当前油量为:"+gass+"升，无法启动！");
    }

    //HasA关系
    Tyre tyre = new Tyre();
    public Tyre getTyreInfo(){
        return  tyre;
    }

}
